<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box1 {
        width: 200px;
        height: 200px;
        /* 
        linear-gradient 线性渐变
        to right 表示渐变方向，向右ss
        gole 表示开始颜色
        red 表示结束颜色
    */
        background-image: linear-gradient(to bottom, red 20%, 40%, gold 80%);
      }
    </style>
  </head>
  <body>
    <div class="box1"></div>
  </body>
</html>
